<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script type="text/javascript">
		function *foo(x){
			yield x * 2;
			yield x * 3;
			return x * 4;
		}
		var it = foo(5);
		console.log(it.next());			//{value:6,done:false}
		console.log( it.next() );   // { value:8, done:false }
		console.log( it.next() );   // { value:42, done:true }
		//yield.html?__hbt=1650764757426:20 {value: 10, done: false}
		//yield.html?__hbt=1650764757426:21 {value: 15, done: false}
		//yield.html?__hbt=1650764757426:22 {value: 20, done: true}
		</script>
	</body>

</html>